home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 352_01.zip / FILESIZE.CPP < prev    next >
C/C++ Source or Header  |  1993-04-10  |  267b  |  17 lines

  1. /* FILESIZE.C - get and return filesize.
  2.  */
  3. #include <stdlib.h>
  4. #include <sys\stat.h>
  5.  
  6. long filesize ( char *spec )
  7.     {
  8.     long l;
  9.     struct stat st;
  10.     
  11.     l = stat ( spec, &st );
  12.     if ( l != -1 )
  13.         {
  14.         l = st.st_size; 
  15.         } 
  16.     return (l);        /* filesize () */
  17.     }